# -*- coding: utf-8 -*-
import uuid
from core import consts
from core.http import http_client


consts.ROOT_URL = "http://127.0.0.1:8801/app-wechat"


def _login_register1():
    api = "/loginApi/loginByPhone"
    url = consts.ROOT_URL + api
    token = uuid.uuid1().__str__()

    data = {
        "loginType": "1",
        "mobilePhone": "18923714596",
        "password": "18923714596",
        "confirmPassword": "18923714596"
    }

    return http_client.post(url=url, data=data, token=token)


def _login_code():
    api = "/loginApi/loginByPhone"
    url = consts.ROOT_URL + api
    token = uuid.uuid1().__str__()

    data = {
        "userLoginName": "18002508891",
        "loginType": "2",
        "mobilePhone": "18002508891",
        "password": "18002508891"
    }

    return http_client.post(url=url, data=data, token=token)


def _login_account():
    api = "/loginApi/loginByPhone"
    url = consts.ROOT_URL + api
    token = uuid.uuid1().__str__()

    data = {
        "userLoginName": "18002508891",
        "loginType": "3",
        "mobilePhone": "18002508891",
        "password": "18002508891"
    }

    return http_client.post(url=url, data=data, token=token)


def _test_register():
    _login_code()


def test():
    _test_register()


if __name__ == "__main__":
    test()
